<script setup lang="ts">
import type { MenuItem } from '@/layouts/menuNavBar'
import NavBarItem from '@/components/NavBarItem.vue'

defineProps<{
  menu: MenuItem[]
}>()

const emit = defineEmits<{
  (e: 'menuClick', event: MouseEvent, item: MenuItem): void
}>()

const menuClick = (event: MouseEvent, item: MenuItem) => {
  emit('menuClick', event, item)
}
</script>

<template>
  <NavBarItem
    v-for="(item, index) in menu"
    :key="index"
    :item="item"
    @menu-click="menuClick"
  />
</template>
